package com.example.demo.entity;

import java.time.LocalDateTime;

/**
 * 评论实体类
 * 对应数据库comments表
 */
public class Comment {
    
    /**
     * 评论ID，主键
     */
    private Long id;
    
    /**
     * 文章ID
     */
    private Long articleId;
    
    /**
     * 父评论ID（回复功能）
     */
    private Long parentId;
    
    /**
     * 评论者姓名
     */
    private String authorName;
    
    /**
     * 评论者邮箱
     */
    private String authorEmail;
    
    /**
     * 评论者网站
     */
    private String authorWebsite;
    
    /**
     * 评论内容
     */
    private String content;
    
    /**
     * IP地址
     */
    private String ipAddress;
    
    /**
     * 用户代理
     */
    private String userAgent;
    
    /**
     * 状态：0-待审核，1-已通过，2-已拒绝
     */
    private Integer status;
    
    /**
     * 点赞数
     */
    private Integer likeCount;
    
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    
    // 关联对象
    /**
     * 文章信息
     */
    private Article article;
    
    /**
     * 父评论信息
     */
    private Comment parentComment;
    
    // 无参构造器
    public Comment() {
    }
    
    // Getter和Setter方法
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getArticleId() {
        return articleId;
    }
    
    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }
    
    public Long getParentId() {
        return parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    
    public String getAuthorName() {
        return authorName;
    }
    
    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }
    
    public String getAuthorEmail() {
        return authorEmail;
    }
    
    public void setAuthorEmail(String authorEmail) {
        this.authorEmail = authorEmail;
    }
    
    public String getAuthorWebsite() {
        return authorWebsite;
    }
    
    public void setAuthorWebsite(String authorWebsite) {
        this.authorWebsite = authorWebsite;
    }
    
    public String getContent() {
        return content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }
    
    public String getIpAddress() {
        return ipAddress;
    }
    
    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }
    
    public String getUserAgent() {
        return userAgent;
    }
    
    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public Integer getLikeCount() {
        return likeCount;
    }
    
    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }
    
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    
    public Article getArticle() {
        return article;
    }
    
    public void setArticle(Article article) {
        this.article = article;
    }
    
    public Comment getParentComment() {
        return parentComment;
    }
    
    public void setParentComment(Comment parentComment) {
        this.parentComment = parentComment;
    }
    
    /**
     * 评论状态常量
     */
    public static class Status {
        public static final int PENDING = 0;  // 待审核
        public static final int APPROVED = 1; // 已通过
        public static final int REJECTED = 2; // 已拒绝
    }
}
